#include <cstdio>
#include <algorithm>
using namespace std;

bool a[1005];

int main() {
	int n, ai, maxa = -1, num;
	scanf("%d", &n);
	num = n;
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &ai);
		if (a[ai]) --num;
		else a[ai] = 1;
		maxa = max(ai, maxa);
	}
	printf("%d\n", num);
	for (int i = 1; i <= maxa; ++i) {
		if (a[i]) printf("%d ", i);
	}
	printf("\n");
	return 0;
}